class Solution
{
public:
    int distinctAverages(vector<int> &nums)
    {
        sort(nums.begin(), nums.end());
        int n = nums.size();
        unordered_set<int> pairNums;
        for (int i = 0; i < n / 2; ++i)
        {
            pairNums.insert(nums[i] + nums[n - 1 - i]);
        }
        return pairNums.size();
    }
};